<%@page import="com.etc.entity.Fix"%>
<%@page import="java.util.List"%>
<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<!DOCTYPE html>
<html style="background: #eee;">
	<head>
	<meta charset="utf-8">
  <title>故障报修</title>
  <meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
        <!-- Bootstrap core CSS -->
    <link href="dist/css/bootstrap.css" rel="stylesheet">
    <!-- Custom styles for this template -->
    <link href="dist/css/dashboard.css" rel="stylesheet">
  <link rel="stylesheet" href="layui/css/layui.css"  media="all">
  
   <link rel="stylesheet" href="css/style.css">
  <link rel="stylesheet" href="css/common.css">
  <link rel="stylesheet" href="css/myLayui.css">
  <link rel="stylesheet" href="css/mycss.css">
    <link rel="stylesheet" href="css/personal.css">

      <script src="dist/js/jquery-3.3.1.js" charset="utf-8"></script>
  <script src="dist/js/bootstrap.js" charset="utf-8"></script>
  <!-- 注意：如果你直接复制所有代码到本地，上述css路径需要改成你本地的 -->
	</head>
  <body class="layui-layout-body">
    
    
    
    <div class="layui-layout layui-layout-admin">
        <div class="layui-header" style="background:#1E89E0 ">
            <ul class="layui-nav" style="padding-left: 100px">
             <div class="w">
             <span class="logo" style="margin-right:100px"><img src="img/logo.png" alt=""></span>
		        <li class="layui-nav-item"><a href="is.do">首页</a></li>
		        <li class="layui-nav-item"><a href="ss.do?op=apartment01">蔡塘悦舍</a></li>
		        <li class="layui-nav-item"><a href="ss.do?op=apartment02">悦舍大院</a></li>
		        <li class="layui-nav-item"><a href="ss.do?op=apartment03">悦舍阔居</a></li>
		        <li class="layui-nav-item"><a href="ts.do?op=query">社区生活</a></li>
		        <li class="layui-nav-item"><a href="is.do?op=about">关于悦舍</a></li>
        <li class="layui-nav-item"><a href="is.do?op=aboutus">关于我们</a></li>
                <li class="layui-nav-item user">
                  <a href=""><img src="<%=request.getAttribute("personImg") %>" class="layui-nav-img"><%=request.getAttribute("personNickName") %></a>
                  <dl class="layui-nav-child">
                      <dd><a href="us.do?op=queryPerson">个人中心</a></dd>
                      <dd><a href="us.do?op=updpwd1">密码修改</a></dd>
                      <dd><a href="us.do?op=removesession">退出</a></dd>
                  </dl>
                  </li>
                  </div>
            </ul>
        </div>
        
        <div class="layui-side layui-bg-black" >

          <div class="layui-side-scroll">
             
            <!-- 头像 -->
            <div class="head-bg">
              <div class="head-pic">
                  <img src="<%=request.getAttribute("personImg") %>" class="layui-nav-img">
              </div>
              <div class="username">昵称：<span><%=request.getAttribute("personNickName") %></span></div>
           
          </div>

            <!-- 左侧导航区域（可配合layui已有的垂直导航） -->
            <ul class="layui-nav layui-nav-tree"  lay-filter="test">
              <li class="layui-nav-item layui-nav-itemed">
                <a class="" href="javascript:;">个人信息</a>
                <dl class="layui-nav-child">
                  <dd><a href="us.do?op=queryPerson">我的资料</a></dd>
                  <dd><a href="us.do?op=updpwd1">修改密码</a></dd>

                </dl>
              </li>
              <li class="layui-nav-item"><a href="us.do?op=queryBypage">查询房租水电</a></li>
              <li class="layui-nav-item"><a href="us.do?op=queryMsg">社区评论</a></li>
              <li class="layui-nav-item layui-this"><a href="us.do?op=queryFix">故障报修</a></li>
            </ul>
          </div>
        </div>
        
        <div class="layui-body">
          <!-- 内容主体区域 -->
          <div class="layui-fluid">
              <div class="layui-row layui-col-space15">
                <div class="layui-col-md8" id="ps_right">
                  <div class="layui-card">
                    <div class="layui-card-header">故障报修</div>
                    <div class="layui-card-body" pad15>
                        <a id="modal-607558" href="#modal-container-607558" role="button" class="btn btn-danger add" data-toggle="modal">故障报修</a>
                      <table class="table table-striped">
                        
                 <thead>
                <tr>
                  <th>编号</th>
                  <th>公寓名称</th>
                  <th>房间号</th>
                  <th>故障描述</th>
                  <th>维修状态</th>
                 
                </tr>
              </thead>
            
        
              <% 
              if(request.getAttribute("list")!=null){
           		Object obj = request.getAttribute("list");
           		if (obj instanceof List){
           			List<Fix> list = (List<Fix>) obj;
           			for (Fix f :list){
         
		%>
		
                <tr>
                  <td><%= f.getFixId() %></td>
                  <td><%= f.getHouseName() %></td>
                  <td><%= f.getHouseDoorNo() %></td>
                  <td><%= f.getFixContent() %></td>
                  <td><%= f.getFixState()==0?"未维修":"已维修" %></td>
                 
                   <td>
   				    <!-- 使用超链接来修改用户 -->
   				<!--     <a id="modal-607558" href="#modal-container-607558" role="button" class="btn btn-danger update" data-toggle="modal">修改</a> -->
                </tr>
              
                <%	} 
           		}
          	} %>
              
                    
			</table>
                        
                      
                    </div>
                  </div>
                </div>
              </div>
            </div>
          
        </div>
        
         <!-- <div class="layui-footer">
         
          © layui.com - 底部固定区域
        </div> -->
      </div>







<!-- 模态窗体 -->
<div class="row clearfix">
		<div class="col-md-12 column">
			 
			
			<div class="modal fade" id="modal-container-607558" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
				<div class="modal-dialog">
					<div class="modal-content">
						<div class="modal-header">
							 <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
							<h4 class="modal-title" id="myModalLabel">
								故障描述
							</h4>
						</div>
						<div class="modal-body">
							<!-- 修改信息模态窗口  开始-->
								<form class="form-horizontal" action="us.do?op=addfix" method="post">
		
					<div class="form-group">
						<label for="priceRemark" class="col-sm-2 control-label">公寓名称</label>
						<div class="col-sm-4">
							<input type="text" class="form-control" placeholder="<%=request.getAttribute("houseName") %>"  id="houseName" readonly="readonly"
							name="houseName">
						</div>
					</div>
				
						<div class="form-group">
						<label for="priceRemark" class="col-sm-2 control-label">房间名字</label>
						<div class="col-sm-4">
							<input type="text" class="form-control" placeholder="<%=request.getAttribute("houseDoorNo") %>"   id="houseDoorNo" readonly="readonly"
							name="houseDoorNo">
						</div>
					</div>
				
					 <div class="layui-form-item layui-form-text">
    					<label class="layui-form-label">维修内容</label>
    					<div class="layui-input-block">
   						   <textarea placeholder="请输入内容" id="fixContent" name="fixContent" class="layui-textarea" ></textarea>
   					  	</div>
 					 </div>
					
					
					<div class="form-group">
						<div class="col-sm-offset-2 col-sm-10">
						</div>
						<div class="modal-footer">
							 <button type="button" class="btn btn-default" data-dismiss="modal">关闭
							 </button> <button type="submit" class="btn btn-primary">添加</button>
						</div> 
						</div>
					
							<!-- 修改信息模态窗口  结束-->
						</div>
						
					</div>
					
				</div>
				
			</div>
			
		</div>
	</div>





<!-- 获取当前用户缴费信息 -->
<script>
	$(function(){
		$(".add").click(function(){
			/* 从table表格获取第二行的第二列和第三列的值 进行模态窗口的展示 */
			var houseName=$(".table").find("tr").eq(1).find("td").eq(1).text();
			var houseDoorNo=$(".table").find("tr").eq(1).find("td").eq(2).text();
			
			console.log(houseName+","+houseDoorNo);
			
			$("#houseName").val(houseName);
			$("#houseDoorNo").val(houseDoorNo);
			
			
			
		});
	});
	</script>






<script src="layui/layui.js" charset="utf-8"></script>
<!-- 注意：如果你直接复制所有代码到本地，上述js路径需要改成你本地的 -->
   <!-- 个人小菜单 -->
   <script>
      layui.use('element', function(){
        var element = layui.element; //导航的hover效果、二级菜单等功能，需要依赖element模块
        //监听导航点击
        element.on('.layui-nav', function(elem){
          //console.log(elem)
          layer.msg(elem.text());
        });
      });
      </script>

      <script>
          layui.use('table', function(){
            var table = layui.table;
            
            table.render({
              elem: '#test'
              ,url:'/demo/table/user/'
              ,cellMinWidth: 80 //全局定义常规单元格的最小宽度，layui 2.2.1 新增
              ,cols: [[
                {field:'id', width: '10%', title: 'ID', sort: true}
                ,{field:'houseName',width: '15%', title: '公寓名 '}
                ,{field:'houseDoorNo',width: '12%',  title: '房间号'}
                ,{field:'fixContent', width: '50%',  title: '维修内容'}
                ,{field:'ffixState', width: '13%', title: '维修状态'}
              ]]
            });
          });
          </script>
	</body>
	
	 <!-- 故障报修添加成功弹窗提示4 -->
	<% if(request.getAttribute("defeat4")!=null){
	  %>
	  <script type="text/javascript">
	  layui.use('layer', function(){
		  var layer = layui.layer;
		  layer.msg('添加成功！！');
		});  

	</script>
 <% 
  }%>
</html>
